#include <netfwd.h>
#include <circlequeue.h>

typedef CircleQueue<int32_t> NumQueue_T;

static NumQueue_T	s_numqueue(10);

int32_t main( int32_t argc, char * argv[] )
{
	if( 0 == s_numqueue.is_exist( 1 ) )
		std::cout << "num[1] not in queue" << std::endl;

	s_numqueue.put( 1 );
	s_numqueue.put( 2 );

	if( 1 == s_numqueue.is_exist( 1 ) )
		std::cout << "num[1] in queue" << std::endl;

	if( 1 == s_numqueue.is_exist( 2 ) )
		std::cout << "num[2] in queue" << std::endl;

	std::cout << "s_numqueue size=" << s_numqueue.size() << std::endl;

	s_numqueue.put( 3 );
	s_numqueue.put( 4 );
	s_numqueue.put( 5 );
	s_numqueue.put( 6 );
	s_numqueue.put( 7 );
	s_numqueue.put( 8 );
	if( s_numqueue.put( 9 ) < 0 )
		std::cout << "s_numqueue put 9 failed!" << std::endl;

	if( s_numqueue.put( 0 ) < 0 )
		std::cout << "s_numqueue put 0 failed!" << std::endl;

	int32_t val = 0;
	s_numqueue.get( val );

	if( 0 == s_numqueue.is_exist( 1 ) )
		std::cout << "num[1] not in queue" << std::endl;

	if( 1 == s_numqueue.is_exist( 9 ) )
		std::cout << "num[9] in queue" << std::endl;

	std::cout << "s_numqueue size=" << s_numqueue.size() << std::endl;
    return 0;
}


